<template>
  <view class="album-container">
    <placardCanvas
      ref="placardRef"
      :imageProp="pictureInfo.compressFileUrl"
      :qrcodeProp="pictureInfo.qrCodeUrl"
      :textProp="pictureInfo.text"
      @hasLoadedImage="canvasLoadedImage"
    ></placardCanvas>

    <view class="button" @click="savePlacard">
      下载海报
    </view>
  </view>
</template>

<script>
import placardCanvas from "@/components/placard-canvas.vue";
export default {
  components: {
    placardCanvas,
  },
  data() {
    return {
      pictureInfo: {
        compressFileUrl: "https://www.baidu.com/picture",
        qrCodeUrl: "",
        text: "",
      },
    };
  },
  onLoad(options) {
    this.loadData(options);
  },
  methods: {
    async loadData(options) {},
    savePlacard() {
      this.$refs.placardRef.saveImage();
    },
	canvasLoadedImage(e) {
		console.log(e)
	},
  },
};
</script>

<style lang="scss" scoped></style>
